﻿// --------------------------------------------------------------------------------------------------------------------
// <copyright file="IDbContextStorage.cs" company="">
//   
// </copyright>
// <summary>
//   Stores object context
// </summary>
// --------------------------------------------------------------------------------------------------------------------

#region

using System.Collections.Generic;
using System.Data.Entity;

#endregion

namespace LGEVH.Infrastructure.Data.DbContexts
{
    /// <summary>
    ///     Stores object context
    /// </summary>
    public interface IDbContextStorage
    {
        /// <summary>
        /// Gets the db context for key.
        /// </summary>
        /// <param name="key">
        /// The key.
        /// </param>
        /// <returns>
        /// The <see cref="DbContext"/>.
        /// </returns>
        DbContext GetDbContextForKey(string key);

        /// <summary>
        /// Sets the db context for key.
        /// </summary>
        /// <param name="key">
        /// The key.
        /// </param>
        /// <param name="objectContext">
        /// The object context.
        /// </param>
        void SetDbContextForKey(string key, DbContext objectContext);

        /// <summary>
        /// Gets all db contexts.
        /// </summary>
        /// <returns>
        /// The <see cref="IEnumerable"/>.
        /// </returns>
        IEnumerable<DbContext> GetAllDbContexts();
    }
}